---
title: HTML to PDF
summary: Render HTML to PDF using the Syncfusion Internet Explorer-based engine.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-17
library: PdfAPI.SyncFusionCore
reference_type: package
operation_id: OP-SFC-010
trigger: Called by ConverterFactory for the html extension
---

# HTML to PDF

Converts an HTML document stream to PDF bytes using the Syncfusion `HtmlToPdfConverter` configured with the Internet Explorer rendering engine.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-SFC-010 |
| **Trigger** | Called by [Execute a single conversion (converter template)](execute-single-conversion.md) via `HtmlConverter.ConvertItem`, dispatched from [Convert a source document to PDF](convert-source-document-to-pdf.md) for `html` |
| **Inputs** | Source `Stream`, `ConvertRequest` |
| **Outputs** | PDF `byte[]` |
| **Primary components** | `HtmlConverter.ConvertItem` |
| **Entry point** | `PdfApi.SyncFusionCore\Convert\HtmlConverter.cs` |

## Steps

1. Read the entire stream as a string using a default-encoding `StreamReader`.
2. Create a `Syncfusion.HtmlConverter.HtmlToPdfConverter` with `IEConverterSettings` (Internet
   Explorer rendering engine) ([BR-SFC-022](../business-rules.md#br-sfc-022-html-rendered-with-ie-engine)).
3. Set `settings.IsPDFA1B = (request.Format == PdfFormat.PdfA)` ([BR-SFC-011](../business-rules.md#br-sfc-011-pdf%2Fa-conformance-level-a1b)).
   - This branch reads `request.Format`, not `request.Options.IsPdfa` as the other converters do —
     the two are equivalent because `ConvertRequest.Format` proxies `Options.OutputFormat`.
4. Call `converter.Convert(html, "")` with an empty base URL, save to a `MemoryStream`, and return
   the bytes ([BR-SFC-023](../business-rules.md#br-sfc-023-html-converted-with-empty-base-url)).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start(["ConvertItem called<br>with stream, request"]) --> Read[Read stream as string]
	Read --> Create["Create HtmlToPdfConverter<br>with IEConverterSettings"]
	Create --> SetPdfa["Set IsPDFA1B from<br>request.Format"]
	SetPdfa --> Convert["converter.Convert html,<br>empty base URL"]
	Convert --> Save[Save to MemoryStream]
	Save --> Return([Return PDF bytes])
```

## Failure and edge-case behavior

- Any Syncfusion conversion failure surfaces as an exception, which is caught by
  [Execute a single conversion (converter template)](execute-single-conversion.md) and turned into a failed `PdfResult` rather than propagated here.
- Relative resource references in the source HTML (images, stylesheets) do not resolve because the
  base URL is empty.
- Untrusted HTML is rendered in-process by a legacy browser engine with no sanitization or
  resource-access restriction configured.*

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts.

## Sources
- `PdfApi.SyncFusionCore\Convert\HtmlConverter.cs`
